<script setup>
import { ref } from 'vue';

let title = ref('this is title')
const updateTitle = () => {
    title.value = '这是一个新标题'
}
// 暴露出去哪些内容
defineExpose({
    title,
    updateTitle
})
</script>

<template>
    <div>
        {{ title }}&nbsp;<button @click="updateTitle">修改标题</button>
    </div>
</template>